<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function add_interest_location($object_id, $lat, $lng, $descriptive_name) {
    if(!$object_id || !$lat || !$lng)
        return FALSE;
    $timestamp = time();
    $query = "INSERT IGNORE INTO interest_locations (object_id, lat, lng, descriptive_name, timestamp)
                VALUES ('$object_id', '$lat', '$lng', '$descriptive_name', '$timestamp')";
    
    return safe_insert_query($query);
}

function get_interest_location($object_id) {
    if(!$object_id)
        return FALSE;
    $query = "SELECT lat, lng, descriptive_name FROM interest_locations WHERE object_id = '$object_id'";
    $result = safe_select_query($query);
    return $result[0];
}

?>
